//迟到图表数据
var beLateOption = {
    tooltip : {
        trigger: 'item',
//      formatter: "{a} <br/>{b} : {d}%",
        formatter:function(param){
//      	console.log(param);
        	var sHtml = '<div><b>'+ param.name +'</b></div>'+
        				'<div><b>迟到人数</b>:<span>'+ param.value +'</span></div>'+
        				'<div><b>占全年级迟到人数比例</b>:<span>'+ param.percent +'%</span></div>';
        	return sHtml;
        }
    },
    legend: {
//      orient: 'vertical',
        left: 'left',
        top: '0%',
        data: ['初一年级老师','初二年纪老师','初三年纪老师','高一年纪老师','高二年纪老师','高三年纪老师']
    },
    series : [
        {
            name: '类目',
            type: 'pie',
//		            type: 'line',
            radius : '55%',
            center: ['50%', '50%'],
            data:[
                {value:19, name:'初一年级老师',itemStyle: {normal:{color: '#EA9294'}}},
                {value:12, name:'初二年纪老师',itemStyle: {normal:{color: '#949494'}}},
                {value:2, name:'初三年纪老师',itemStyle: {normal:{color: '#A4D2D5'}}},
                {value:8, name:'高一年纪老师',itemStyle: {normal:{color: '#F1C0B1'}}},
                {value:6, name:'高二年纪老师',itemStyle: {normal:{color: '#BAD7CB'}}},
                {value:1, name:'高三年纪老师',itemStyle: {normal:{color: '#8B99A1'}}},
            ],
            itemStyle: {
                emphasis: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
};

//旷工图表数据
var absenteeismOption = {
    tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b}: {c}人 ({d}%)"
    },
    legend: {
        orient: 'vertical',
        x: 'left',
        data:['初一老师','初二老师','初三老师','高一老师','高二老师','高三老师']
    },
    series: [
        {
            name:'本学期旷工数据',
            type:'pie',
            radius: ['50%', '70%'],
            avoidLabelOverlap: false,
            label: {
                normal: {
                    show: false,
                    position: 'center'
                },
                emphasis: {
                    show: true,
                    textStyle: {
                        fontSize: '30',
                        fontWeight: 'bold'
                    }
                }
            },
            labelLine: {
                normal: {
                    show: false
                }
            },
            data:[
                {value:14, name:'初一老师'},
                {value:11, name:'初二老师'},
                {value:3, name:'初三老师'},
                {value:5, name:'高一老师'},
                {value:15, name:'高二老师'},
                {value:8, name:'高三老师'}
            ]
        }
    ]
};


//早退图表数据
var leaveEarlyOption = {
    backgroundColor: '#00265f',
    tooltip : {
        trigger: 'item',
//      formatter: "{a} <br/>{b} : {d}%",
        formatter:function(param){
//      	console.log(param);
        	var sHtml = '<div><b>'+ param.name +'老师</b></div>'+
        				'<div><b>早退人数</b>:<span>'+ param.value +'</span></div>'+
        				'<div><b>占全年级早退人数比例</b>:<span>'+ (param.value/param.data.total*100).toFixed(2) +'%</span></div>';
        	return sHtml;
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis: [{
        type: 'category',
        data: ['初一','初二','初三','高一','高二','高三'],
        axisLine: {
            show: true,
            lineStyle: {
                color: "#063374",
                width: 1,
                type: "solid"
            }
        },
        axisTick: {
            show: false
        },
        axisLabel: {
            show: true,
            textStyle: {
                color: "#00c7ff",
            }
        },
    }],
    yAxis: [{
        type: 'value',
        axisLabel: {
//          formatter: '{value} %',
            formatter: function(param){
//          	console.log(param);
            	return param + "人"  ;
            }
        },
        axisLine: {
            show: false,
            lineStyle: {
                color: "#00c7ff",
                width: 1,
                type: "solid"
            },
        },
        axisTick: {
            show: false
        },
        splitLine: {
            lineStyle: {
                color: "#063374",
            }
        }
    }],
   
    series: [{
        type: 'bar',
//      data: [2, 5, 8, 10, 3, 6],
        data: [
        	{value:2,total:34},
        	{value:5,total:34},
        	{value:8,total:34},
        	{value:10,total:34},
        	{value:3,total:34},
        	{value:6,total:34}
        ],
        //barWidth: 50, //柱子宽度
        //barGap: 1, //柱子之间间距
        itemStyle: {
            normal: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                    offset: 0,
                    color: '#00fcae'
                }, {
                    offset: 1,
                    color: '#006388'
                }]),
                opacity: 1,
            }
        }
    }]
};

//在校图表数据
var onSchoolOption = {
    backgroundColor: '#00265f',
    tooltip : {
        trigger: 'item',
//      formatter: "{a} <br/>{b} : {d}%",
        formatter:function(param){
//      	console.log(param);
        	var sHtml = '<div><b>'+ param.name +'老师</b></div>'+
        				'<div><b>在校人数</b>:<span>'+ param.value +'</span></div>'+
        				'<div><b>占全年级在校人数比例</b>:<span>'+ (param.value/param.data.total*100).toFixed(2) +'%</span></div>';
        	return sHtml;
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis: [{
        type: 'category',
        data: ['初一','初二','初三','高一','高二','高三'],
        axisLine: {
            show: true,
            lineStyle: {
                color: "#063374",
                width: 1,
                type: "solid"
            }
        },
        axisTick: {
            show: false
        },
        axisLabel: {
            show: true,
            textStyle: {
                color: "#00c7ff",
            }
        },
    }],
    yAxis: [{
        type: 'value',
        axisLabel: {
//          formatter: '{value} %',
            formatter: function(param){
            	return param + "人"  ;
            }
        },
        axisLine: {
            show: false,
            lineStyle: {
                color: "#00c7ff",
                width: 1,
                type: "solid"
            },
        },
        axisTick: {
            show: false
        },
        splitLine: {
            lineStyle: {
                color: "#063374",
            }
        }
    }],
   
    series: [{
        type: 'bar',
//      data: [2, 5, 8, 10, 3, 6],
        data: [
        	{value:18,total:100},
        	{value:25,total:100},
        	{value:12,total:100},
        	{value:5,total:100},
        	{value:20,total:100},
        	{value:20,total:100}
        ],
        //barWidth: 50, //柱子宽度
        //barGap: 1, //柱子之间间距
        itemStyle: {
            normal: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                    offset: 0,
                    color: '#00fcae'
                }, {
                    offset: 1,
                    color: '#006388'
                }]),
                opacity: 1,
            }
        }
    }]
};

